﻿using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Acme.BookStore2.Controllers
{
    [RemoteService(Name = "Default")]
    [Area("bookstore2")]
    [ControllerName("QuestionAndAnswerPost")]
    [Route("api/bookstore2/questionAndAnswerPosts")]
    public class QuestionAndAnswerPostController : BookStore2Controller, IQuestionAndAnswerPostAppService
    {
        private readonly IQuestionAndAnswerPostAppService _vehicleAppService;

        public QuestionAndAnswerPostController(IQuestionAndAnswerPostAppService vehicleAppService)
        {
            _vehicleAppService = vehicleAppService;
        }
        
        [HttpGet]
        [Route("{id}")]
        public Task<QuestionAndAnswerPostDto> GetAsync(Guid id)
        {
            return _vehicleAppService.GetAsync(id);
        }
        
        [HttpGet]
        public Task<PagedResultDto<QuestionAndAnswerPostDto>> GetPagedListAsync(GetQuestionAndAnswerPostsInput input)
        {
            return _vehicleAppService.GetPagedListAsync(input);
        }
        
        [HttpPost]
        public Task<QuestionAndAnswerPostDto> CreateAsync(QuestionAndAnswerPostCreateDto input)
        {
            return _vehicleAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<QuestionAndAnswerPostDto> UpdateAsync(Guid id, QuestionAndAnswerPostUpdateDto input)
        {
            return _vehicleAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return _vehicleAppService.DeleteAsync(id);
        }
    }
}